feat: Setup automatic test when PR is open on main #48
+25
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
It allows to automatically run
rpm run test
when a PR is made to merge into main.It does so by creating a
test-on-pull-request.yml
file inside the folder.github/worflows
.Explanation of the Workflow:
on: pull_request
: This specifies that the workflow should run on a pull request event.jobs
: Defines the jobs that will run as part of this workflow.runs-on: ubuntu-latest
: The environment where the job will run, here it's an Ubuntu machine.steps
: The specific steps the job will execute:Checkout repository
: This step checks out your repository so the workflow can access the code.Set up Node.js
: This step installs the specified version of Node.js.Install dependencies
: This stepruns npm install
to install the necessary dependencies.Run tests: Finally, this step runs your test script using
npm run test
.Before merging we should now see the test being passed: